let uu = document.querySelector('#product ul')
fetch('http://chst.vip:1234/api/getmoneyctrl')
    .then(body => body.json())
    .then(res1 => {
        console.log(res1)
        let el = ""
        res1.result.forEach(item => {
            let regExp1 = /(?<=imgurl=)[^'"]*/;
            let reg = item.productImg2.match(regExp1)
            el += `<li productid=${item.productId}>
                <img src=${reg[0]} productid=${item.productId}>
                <div ><h4 productid=${item.productId}>${item.productName}
                <span productid=${item.productId}>${item.productPinkage}</span>
                </h4></div>
                <em productid=${item.productId}>${item.productFrom} |${item.productTime}</em>
                <h1 productid=${item.productId}>${item.productComCount}</h1>
                </li>`
        })
        uu.innerHTML = el
    })
    console.log(uu)
uu.onclick = function (e) {
    if(e.target.localName=='li' || e.target.localName=='img' || e.target.localName=='h4' || e.target.localName=='em' || e.target.localName=='h1') {
        let _this = e.target
        let id = _this.getAttribute('productid')
        location.href = './../pages/detail.html?productid=' + id;
    }
}